<html>
<head><meta charset="utf-8"><title>highfive&#x27;s ping config · t-infra · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/index.html">t-infra</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/highfive&#x27;s.20ping.20config.html">highfive&#x27;s ping config</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="237944977"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242791-t-infra/topic/highfive%27s%20ping%20config/near/237944977" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yuki Okushi <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/highfive&#x27;s.20ping.20config.html#237944977">(May 08 2021 at 10:24)</a>:</h4>
<p>I should've set the ping config for highfive on the libc repo: <a href="https://github.com/rust-lang/highfive/commit/e14e13c3928063d94398424c07ebd401be8c4f3f">https://github.com/rust-lang/highfive/commit/e14e13c3928063d94398424c07ebd401be8c4f3f</a><br>
but it doesn't seem to work well (semarie should be pinged on this PR): <a href="https://github.com/rust-lang/libc/pull/2164">https://github.com/rust-lang/libc/pull/2164</a><br>
Should a person be a member of the org or am I missing something?</p>



<a name="237971809"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242791-t-infra/topic/highfive%27s%20ping%20config/near/237971809" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/highfive&#x27;s.20ping.20config.html#237971809">(May 08 2021 at 17:26)</a>:</h4>
<p>I think it is a bug in highfive.  The following I think should fix it:</p>
<div class="codehilite" data-code-language="Diff"><pre><span></span><code><span class="gh">diff --git a/highfive/newpr.py b/highfive/newpr.py</span>
<span class="gh">index 386f9cd..661eb3b 100644</span>
<span class="gd">--- a/highfive/newpr.py</span>
<span class="gi">+++ b/highfive/newpr.py</span>
<span class="gu">@@ -315,13 +315,12 @@ class HighfiveHandler(object):</span>
         """
         Get the list of people to mention.
         """
<span class="gd">-        dirs = self.repo_config.get('dirs', {})</span>
         mentions = self.repo_config.get('mentions', {})

         to_mention = set()
         # If there's directories with specially assigned groups/users
         # inspect the diff to find the directory with the most additions
<span class="gd">-        if dirs:</span>
<span class="gi">+        if mentions:</span>
             cur_dir = None
             for line in diff.split('\n'):
                 if line.startswith("diff --git "):
</code></pre></div>



<a name="237971862"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242791-t-infra/topic/highfive%27s%20ping%20config/near/237971862" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/highfive&#x27;s.20ping.20config.html#237971862">(May 08 2021 at 17:27)</a>:</h4>
<p>Or maybe this to reduce the rightwards drift:</p>
<div class="codehilite" data-code-language="Diff"><pre><span></span><code><span class="gh">diff --git a/highfive/newpr.py b/highfive/newpr.py</span>
<span class="gh">index 386f9cd..7ac9731 100644</span>
<span class="gd">--- a/highfive/newpr.py</span>
<span class="gi">+++ b/highfive/newpr.py</span>
<span class="gu">@@ -315,39 +315,39 @@ class HighfiveHandler(object):</span>
         """
         Get the list of people to mention.
         """
<span class="gd">-        dirs = self.repo_config.get('dirs', {})</span>
         mentions = self.repo_config.get('mentions', {})
<span class="gi">+        if not mentions:</span>
<span class="gi">+            return []</span>

         to_mention = set()
         # If there's directories with specially assigned groups/users
         # inspect the diff to find the directory with the most additions
<span class="gd">-        if dirs:</span>
<span class="gd">-            cur_dir = None</span>
<span class="gd">-            for line in diff.split('\n'):</span>
<span class="gd">-                if line.startswith("diff --git "):</span>
<span class="gd">-                    # update cur_dir</span>
<span class="gd">-                    cur_dir = None</span>
<span class="gd">-                    parts = line[line.find(" b/") + len(" b/"):].split("/")</span>
<span class="gd">-                    if not parts:</span>
<span class="gd">-                        continue</span>
<span class="gd">-                    cur_dir = "/".join(parts[:2])</span>
<span class="gd">-                    full_dir = "/".join(parts)</span>
<span class="gi">+        cur_dir = None</span>
<span class="gi">+        for line in diff.split('\n'):</span>
<span class="gi">+            if line.startswith("diff --git "):</span>
<span class="gi">+                # update cur_dir</span>
<span class="gi">+                cur_dir = None</span>
<span class="gi">+                parts = line[line.find(" b/") + len(" b/"):].split("/")</span>
<span class="gi">+                if not parts:</span>
<span class="gi">+                    continue</span>
<span class="gi">+                cur_dir = "/".join(parts[:2])</span>
<span class="gi">+                full_dir = "/".join(parts)</span>

<span class="gd">-                    # A few heuristics to get better reviewers</span>
<span class="gd">-                    if cur_dir.startswith('src/librustc'):</span>
<span class="gd">-                        cur_dir = 'src/librustc'</span>
<span class="gd">-                    if cur_dir == 'src/test':</span>
<span class="gd">-                        cur_dir = None</span>
<span class="gd">-                    if len(full_dir) &gt; 0:</span>
<span class="gd">-                        for entry in mentions:</span>
<span class="gd">-                            # Check if this entry is a prefix</span>
<span class="gd">-                            eparts = entry.split("/")</span>
<span class="gd">-                            if (len(eparts) &lt;= len(parts) and</span>
<span class="gd">-                                all(a==b for a,b in zip(parts, eparts))</span>
<span class="gd">-                            ):</span>
<span class="gd">-                                to_mention.add(entry)</span>
<span class="gd">-                            elif entry.endswith('.rs') and full_dir.endswith(entry):</span>
<span class="gd">-                                to_mention.add(entry)</span>
<span class="gi">+                # A few heuristics to get better reviewers</span>
<span class="gi">+                if cur_dir.startswith('src/librustc'):</span>
<span class="gi">+                    cur_dir = 'src/librustc'</span>
<span class="gi">+                if cur_dir == 'src/test':</span>
<span class="gi">+                    cur_dir = None</span>
<span class="gi">+                if len(full_dir) &gt; 0:</span>
<span class="gi">+                    for entry in mentions:</span>
<span class="gi">+                        # Check if this entry is a prefix</span>
<span class="gi">+                        eparts = entry.split("/")</span>
<span class="gi">+                        if (len(eparts) &lt;= len(parts) and</span>
<span class="gi">+                            all(a==b for a,b in zip(parts, eparts))</span>
<span class="gi">+                        ):</span>
<span class="gi">+                            to_mention.add(entry)</span>
<span class="gi">+                        elif entry.endswith('.rs') and full_dir.endswith(entry):</span>
<span class="gi">+                            to_mention.add(entry)</span>

         mention_list = []
         for mention in to_mention:
</code></pre></div>



<a name="238162069"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242791-t-infra/topic/highfive%27s%20ping%20config/near/238162069" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yuki Okushi <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/highfive&#x27;s.20ping.20config.html#238162069">(May 10 2021 at 15:31)</a>:</h4>
<p>Thanks for investigating it! <span class="user-mention" data-user-id="120518">@Eric Huss</span>  Would you mind sending a PR? I'm not sure if I have some time to take a look and send it currently :(</p>



<a name="239973801"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242791-t-infra/topic/highfive%27s%20ping%20config/near/239973801" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yuki Okushi <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/highfive&#x27;s.20ping.20config.html#239973801">(May 23 2021 at 19:47)</a>:</h4>
<p>fyi: pr is posted <a href="https://github.com/rust-lang/highfive/pull/336">https://github.com/rust-lang/highfive/pull/336</a>, thanks for your insight :)</p>



<a name="240057184"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242791-t-infra/topic/highfive%27s%20ping%20config/near/240057184" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/highfive&#x27;s.20ping.20config.html#240057184">(May 24 2021 at 14:17)</a>:</h4>
<p>gah, sorry I didn't respond! This got lost in the shuffle, thanks for finishing it up.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>